home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / mpimagelib.lha / docs / MPImage.doc
Text File  |  1997-02-16  |  25KB  |  858 lines

  1.  
  2.  
  3. TABLE OF CONTENTS
  4.  
  5. MPImage.library/--background--
  6. MPImage.library/FreeMPImage
  7. MPImage.library/LoadMPImage
  8. MPImage.library/MPChunkyToPlanar
  9. MPImage.library/MPGreyToPal
  10. MPImage.library/MPImageErrorMessage
  11. MPImage.library/MPPalToGrey
  12. MPImage.library/MPPalToPal
  13. MPImage.library/MPPalToRGB
  14. MPImage.library/MPPlanarToChunky
  15. MPImage.library/MPProgressHook
  16. MPImage.library/MPRGBToGrey
  17. MPImage.library/MPRGBToPal
  18. MPImage.library/MPScaleGrey
  19. MPImage.library/MPScaleRGB
  20. MPImage.library/RescaleMPImage
  21. MPImage.library/SaveMPImageA
  22. MPImage.library/SetMPImageScreen
  23.  
  24.  
  25. MPImage.library/--background--                  MPImage.library/--background--
  26.  
  27.  MPImage.library lets you load save and process images.
  28.  
  29.  Stuctures/Formats:
  30.  
  31.   RGB Chunky    This is held as seperate Red Green and Blue
  32.                 UBYTE *, with a Width and Height
  33.   Grey Chunky   This is held as one Grey UBYTE * (often called
  34.                 red), with a Width and a Height.
  35.   Palette       This is held as one UBYTE[768] (sometimes called
  36.                 red, a Width and Height, and a UBYTE *Palette. The
  37.                 palette holds the red palette in [0] to [255],
  38.                 the green palette in [256] to [511] and the blue
  39.                 palette in [512] to [767]. There may also be a
  40.                 camg (or modeid) and a number of colours, or
  41.                 number of planes. These are required for EHB and
  42.                 HAM images.
  43.   Bitmap        A normal planar bit map. This also has other
  44.                 fields as for Palette.
  45.   EGSBitMap     A standard EGSBitMap.
  46.   MPImage       This holds one of RGB, Grey, Bitmap or EGSBitMap.
  47.   MPProcess     This holds the RGB pointers and width and height.
  48.                 It is used for some processing functions.
  49.  
  50.  Image Loading:
  51.  
  52.   LoadMPImage()   Loads an image from disc/clipboard.
  53.                   It loads various formats.
  54.                   Returns BitMap, RGB, GreyScale or EGSBitMap.
  55.  
  56.  Image Saving:
  57.  
  58.   SaveMPImage()   Can save RGB/GreyScale to disc.
  59.                   It saves in various formats.
  60.  
  61.  ImageScaling:
  62.  
  63.   RescaleMPImage() Scales a loaded image (any format).
  64.  
  65.  Displaying Images
  66.  
  67.   SaveMPImage()    Can display RGB/GreyScale Buffers.
  68.  
  69.  Miscellaneous:
  70.  
  71.   FreeMPImage()         Frees a loaded image.
  72.   SetMPImageScreen()    Sets the screen for the progress requester.
  73.   MPProgressHook()      Sets a progress hook for messages.
  74.   MPImageErrorMessage() Returns the last error message.
  75.  
  76.  Planar/Chunky Conversion:
  77.  
  78.   MPPlanarToChunky() Converts a BitMap to a chunky buffer.
  79.   MPChunkyToPlanar() Converts a chunky buffer to a BitMap.
  80.   SaveMPImage()      Can convert RGB Buffers to a BitMap.
  81.  
  82.  Image processing:
  83.  
  84.   Image processing is done on chunky buffers; RGB, GreyScale
  85.   or Palette based. The following convert between these formats.
  86.  
  87.   MPGreyToPal()  GreyScale to Palette.
  88.   MPPalToGrey()  Palette to GreyScale.
  89.   MPPalToPal()   Palette to a different Palette.
  90.   MPPalToRGB()   Palette to RGB.
  91.   MPRGBToGrey()  RGB To Grey.
  92.   MPRGBToPal()   RGB To Palette.
  93.  
  94.   Buffers can also be scaled:
  95.  
  96.   MPScaleGrey()  Scales one buffer.
  97.   MPScaleRGB()   Scales 3 buffers.
  98.                  Same as 3 calls to MPScaleGrey() but faster.
  99.  
  100.  Summary:
  101.  
  102.  Input                            Output Format
  103.  Format   !Disc! RGB !Gray !Palette!BitMap!EGSBitMap!MPImage!Screen
  104.  ---------!----!-----!-----!-------!------!---------!-------!------
  105.  Disc/Clip!    !1*   !1*   !       !1*    !1*       !1      !
  106.  RGB      !2   !13,3*!10   !11     !2     !         !       !2
  107.  Gray     !2   !x    !12,3*!6      !2     !         !       !2
  108.  Palette  !    !9    !7    !8      !5     !         !       !
  109.  BitMap   !    !     !     !4      !3*,o  !         !       !
  110.  EGSBitMap!    !     !     !       !      !3*       !       !
  111.  MPImage  !2+  !+    !+    !#      !+     !+        !3      !2+
  112.  
  113.   1 - LoadMPImage()
  114.   2 - SaveMPImage()
  115.   3 - RescaleMPImage()
  116.   4 - MPPlanarToChunky()
  117.   5 - MPChunkyToPlanar()
  118.   6 - MPGreyToPal()
  119.   7 - MPPalToGrey()
  120.   8 - MPPalToPal()
  121.   9 - MPPalToRGB()
  122.  10 - MPRGBToGrey()
  123.  11 - MPRGBToPal()
  124.  12 - MPScaleGrey()
  125.  13 - MPScaleRGB()
  126.   * - As part of an MPImage
  127.   + - Depends on parameters to LoadMPImage
  128.   x - Easy - no function supplied
  129.   o - See BitMapScale()
  130.   # - Depends on LoadMPImage, use 11,6,8 or 4
  131.  
  132. MPImage.library/FreeMPImage                        MPImage.library/FreeMPImage
  133.  
  134.    NAME   
  135.   FreeMPImage -- Free an image loaded using LoadMPImage() (V3)
  136.  
  137.    SYNOPSIS
  138.   FreeMPImage( MPi )
  139.                A0
  140.  
  141.   void FreeMPImage( struct MPImage * );
  142.  
  143.    FUNCTION
  144.   Frees all data associated loaded with an image using LoadMPImage().
  145.  
  146.    INPUTS
  147.   MPi - structure returned by LoadMPImage().
  148.  
  149.    RESULT
  150.   None.
  151.  
  152.    EXAMPLE
  153.  
  154.    NOTES
  155.  
  156.    BUGS
  157.  
  158.    SEE ALSO
  159.   LoadMPImage()
  160.  
  161. MPImage.library/LoadMPImage                        MPImage.library/LoadMPImage
  162.  
  163.    NAME   
  164.   LoadMPImage -- Load an image in various formats (V4)
  165.  
  166.    SYNOPSIS
  167.   MPi = LoadMPImage( filename,screen,Flags )
  168.   D0                       A0       A1     D0
  169.  
  170.   struct MPImage *LoadMPImage
  171.                   ( const char *,struct Screen *,ULONG);
  172.  
  173.    FUNCTION
  174.   Load an image in BitMap, EGSBitMap or RGB format.
  175.  
  176.    INPUTS
  177.   filename - name of file from which to load image
  178.            - -c or -cnumber for clipboard
  179.   screen   - screen on which BitMap is to be used. May be NULL.
  180.   Flags    - Flags to control image loading
  181.       Default is to remap to screen palette and return a bitmap in BitMap
  182.       Only way to free is to call FreeMPImage().
  183.  
  184.       MPIF_EGS         - Return E_EBitMap rather than BitMap. 
  185.           Overrides MPIF_RGB
  186.       MPIF_CLONEBITMAP - You are free to zero BitMap/EGS_BitMap before
  187.           calling FreeMPImage(). You must then call FreeBitMap() or 
  188.           E_DisposeBitMap() yourself. Ignored for MPIF_RGB/GREY. If screen
  189.           supplied then clone is screen depth deep if possible.
  190.       MPIF_NOREMAP     - Don't remap to the current screen colors. Ignored
  191.           for MPIF_EGS/RGB/GREY. Returns error if 24 bit input.
  192.       MPIF_RGB         - return Red, Green, Blue instead of BitMap.
  193.       MPIF_GREY        - return Red, Green, Blue instead of BitMap. If
  194.           image is greyscale then Red, Green and Blue will be the same
  195.           and GreyScale will be TRUE
  196.       MPIF_FORCEGREY   - As MPIF_GREY except input will always be remapped
  197.           to greyscale.
  198.       MPIF_LINEARGREY  - Use linear (not colour based) mapping (V5.0)
  199.  
  200.    RESULT
  201.   MPi - Pointer to an MPImage structure holding the image data.
  202.         NULL if an error occurs. Use MPImageErrorMessage() to get error.
  203.  
  204.    EXAMPLE
  205.  
  206.    NOTES
  207.   If file format is JPG and env/mpimage/djpeg is set (e.g. djpeg "%s" "%s")
  208.   and not loading a BitMap then djpeg is used.
  209.  
  210.   If file format is PNG and env/mpimage/pngtopnm is set
  211.   (e.g. pngtopnm "%s" >"%s") and not loading a BitMap then pngtopnm is used.
  212.  
  213.   Other fileformats are IBLM (depth 1 to 8 and 24, EHB, HAM6 and HAM8),
  214.   PBM (all types) and any picture datatype. With dctv.library(3) can also
  215.   load DCTV images.
  216.  
  217.    BUGS
  218.   Waits 20 seconds for djpeg/pngtopnm to start then aborts.
  219.   Fails to set an error message if failure loading from clipboard.
  220.   Can also fail to set an error message in other (unknown) circumstances.
  221.  
  222.    SEE ALSO
  223.   FreeMPImage(),MPImageErrorMessage,graphics.library/FreeBitMap(),
  224.   egs.library/E_DisposeBitMap(),MPImageErrorMessage().
  225.  
  226. MPImage.library/MPChunkyToPlanar              MPImage.library/MPChunkyToPlanar
  227.  
  228.    NAME   
  229.   MPChunkyToPlanar -- Convert a chunky buffer to a BitMap (V7)
  230.  
  231.    SYNOPSIS
  232.   MPChunkyToPlanar( chunky, bitmap, width, height )
  233.                     A0      A1      D0     D1
  234.  
  235.   void MPPlanarToChunky( UBYTE *, struct BitMap *, UWORD, UWORD);
  236.  
  237.    FUNCTION
  238.   Converts a chunky buffer to a BitMap.
  239.  
  240.    INPUTS
  241.   chunky - Pointer to a chunky buffer of sufficient size.
  242.   bitmap - Pointer to a standard bitmap (of sufficient size).
  243.   width  - Width of buffer.
  244.   height - Height of buffer.
  245.  
  246.    RESULT
  247.   None.
  248.  
  249.    EXAMPLE
  250.  
  251.    NOTES
  252.  
  253.    BUGS
  254.  
  255.    SEE ALSO
  256.   MPPlanarToChunky().
  257.  
  258. MPImage.library/MPGreyToPal                        MPImage.library/MPGreyToPal
  259.  
  260.    NAME   
  261.   MPGreyToPal -- Convert GreyScale image to a palette (V7)
  262.  
  263.    SYNOPSIS
  264.   MPGreyToPal( MPp,maxcol,pal )
  265.                A0  D0     A1
  266.  
  267.   void MPGreyToPal
  268.                 ( struct MPProcess *,ULONG,UBYTE *,BOOL);
  269.  
  270.    FUNCTION
  271.   Convert Grey to a palette.
  272.  
  273.    INPUTS
  274.   MPp      - Contains (in Read) the GreyScale chunky pixels
  275.              and the Width and Height
  276.   maxcol   - The number of colours in the palette.
  277.   pal      - The palette. This is a 768 byte array.
  278.              r[0] to r[maxcol] hold the Red palette
  279.              r[256] to r[256+maxcol] hold the Green palette
  280.              r[512] to r[512+maxcol] hold the Blue palette
  281.  
  282.    RESULT
  283.   The data pointed to by MPp->Red is updated to the palette mapped image.
  284.  
  285.    EXAMPLE
  286.  
  287.    NOTES
  288.  
  289.    BUGS
  290.   Not tested.
  291.  
  292.    SEE ALSO
  293.   MPRGBToPal().
  294.  
  295. MPImage.library/MPImageErrorMessage        MPImage.library/MPImageErrorMessage
  296.  
  297.    NAME   
  298.   MPImageErrorMessage -- Return the last error set by MPImage.library. (V3)
  299.  
  300.    SYNOPSIS
  301.   msg = MPImageErrorMessage()
  302.   D0
  303.  
  304.   char *MPImageErrorMessage( void );
  305.  
  306.    FUNCTION
  307.   Returns the last error message set by this opener of MPImage.library.
  308.  
  309.    INPUTS
  310.   None.
  311.  
  312.    RESULT
  313.   Formatted Error Message.
  314.  
  315.    EXAMPLE
  316.  
  317.    NOTES
  318.  
  319.    BUGS
  320.  
  321.    SEE ALSO
  322.  
  323. MPImage.library/MPPalToGrey                        MPImage.library/MPPalToGrey
  324.  
  325.    NAME   
  326.   MPPalToGrey -- Convert palette image to GreyScale (V7)
  327.  
  328.    SYNOPSIS
  329.   MPPalToGrey(Width,Height,pal,chunky,nPlanes,camg,Linear);
  330.               D0    D1     A0  A1      D2     D3   D4
  331.  
  332.   void MPPalToGrey
  333.              (UWORD,UWORD,UBYTE *,UBYTE *,UWORD,ULONG,BOOL);
  334.  
  335.    FUNCTION
  336.   Convert palette image to GreyScale.
  337.  
  338.    INPUTS
  339.   Width    - Width of image.
  340.   Height   - Height of image.
  341.   pal      - The current palette. This is a 768 byte array.
  342.              [0] to [...] hold the Red palette
  343.              [256] to [256+...] hold the Green palette
  344.              [512] to [512+...] hold the Blue palette
  345.   chunky   - The current chunky pixels.
  346.   nPlanes  - The number of planes in the current palette.
  347.   camg     - The camg of the current palette.
  348.   Linear   - If True then map linear,
  349.              otherwise give more weight to Green.
  350.  
  351.    RESULT
  352.   The data pointed to by chunky is updated to the GreyScale pixels.
  353.  
  354.    EXAMPLE
  355.  
  356.    NOTES
  357.   nPlanes and camg are required to cater for EHB and HAM.
  358.  
  359.    BUGS
  360.   Not tested.
  361.  
  362.    SEE ALSO
  363.   MPPalToRGB().
  364.  
  365. MPImage.library/MPPalToPal                          MPImage.library/MPPalToPal
  366.  
  367.    NAME   
  368.   MPPalToPal -- Convert image with one palette to another palette (V7)
  369.  
  370.    SYNOPSIS
  371.   MPPalToPal(OldPal,OldCols,NewPal,NewCols,chunky,Width,Height,
  372.              nPlanes,camg);
  373.              A0     D0      A1     D1      A2     D2    D3
  374.              D4      D5
  375.  
  376.   void MPPalToPal
  377.              ( UBYTE *,ULONG,UBYTE *,ULONG,UBYTE *,UWORD,UWORD,
  378.                UWORD, ULONG);
  379.  
  380.    FUNCTION
  381.   Convert image with one palette to another palette.
  382.  
  383.    INPUTS
  384.   OldPal   - The current palette. This is a 768 byte array.
  385.              [0] to [maxcol] hold the Red palette
  386.              [256] to [256+maxcol] hold the Green palette
  387.              [512] to [512+maxcol] hold the Blue palette
  388.   OldCols  - The number of colours in the current palette.
  389.   NewPal   - The new palette. This is a 768 byte array.
  390.              [0] to [maxcol] hold the Red palette
  391.              [256] to [256+maxcol] hold the Green palette
  392.              [512] to [512+maxcol] hold the Blue palette
  393.   NewCols  - The number of colours in the new palette.
  394.   chunky   - The chunky pixels.
  395.   Width    - The width of the image.
  396.   Height   - The height of the image.
  397.   nPlanes  - The number of planes in the current palette
  398.   camg     - The camg of the current palette
  399.  
  400.    RESULT
  401.   The data pointed to by chunky is updated to the new palette.
  402.  
  403.    EXAMPLE
  404.  
  405.    NOTES
  406.   nPlanes and camg are required to cater for EHB and HAM.
  407.  
  408.    BUGS
  409.   Not tested.
  410.  
  411.    SEE ALSO
  412.  
  413. MPImage.library/MPPalToRGB                          MPImage.library/MPPalToRGB
  414.  
  415.    NAME   
  416.   MPPalToRGB -- Convert palette image to RGB (V7)
  417.  
  418.    SYNOPSIS
  419.   MPPalToRGB(MPp,pal,chunky,nPlanes,camg);
  420.              A0  A1  A2     D0      D1
  421.  
  422.   void MPPalToRGB
  423.              ( struct MPProcess *,UBYTE *,UBYTE *,UWORD,ULONG);
  424.  
  425.    FUNCTION
  426.   Convert palette image to RGB.
  427.  
  428.    INPUTS
  429.   MPp      - Holds buffers to store the Red, Green and Blue pixels
  430.              and the Width and the Height.
  431.   pal      - The current palette. This is a 768 byte array.
  432.              [0] to [...] hold the Red palette
  433.              [256] to [256+...] hold the Green palette
  434.              [512] to [512+...] hold the Blue palette
  435.   chunky   - The current chunky pixels.
  436.   nPlanes  - The number of planes in the current palette
  437.   camg     - The camg of the current palette
  438.  
  439.    RESULT
  440.   The data pointed to by MPp->Red, MPp->Green and MPp->Blue are updated
  441.   to the RGB pixels.
  442.  
  443.    EXAMPLE
  444.  
  445.    NOTES
  446.   nPlanes and camg are required to cater for EHB and HAM.
  447.  
  448.    BUGS
  449.   Not tested.
  450.  
  451.    SEE ALSO
  452.   MPPalToGrey().
  453.  
  454. MPImage.library/MPPlanarToChunky              MPImage.library/MPPlanarToChunky
  455.  
  456.    NAME   
  457.   MPPlanarToChunky -- Convert a bitmap to a chunky buffer (V5)
  458.  
  459.    SYNOPSIS
  460.   MPPlanarToChunky( bitmap, chunky, width, height )
  461.                     A0      A1      D0     D1
  462.  
  463.   void MPPlanarToChunky( struct BitMap *, UBYTE *, UWORD, UWORD);
  464.  
  465.    FUNCTION
  466.   Converts a BitMap to a chunky buffer.
  467.  
  468.    INPUTS
  469.   bitmap - Pointer to a standard bitmap.
  470.   chunky - Pointer to a chunky buffer of sufficient size.
  471.   width  - Width of bitmap.
  472.   height - Height of bitmap.
  473.  
  474.    RESULT
  475.   None.
  476.  
  477.    EXAMPLE
  478.  
  479.    NOTES
  480.  
  481.    BUGS
  482.  
  483.    SEE ALSO
  484.   MPChunkyToPlanar().
  485.  
  486. MPImage.library/MPProgressHook                  MPImage.library/MPProgressHook
  487.  
  488.    NAME   
  489.   MPProgressHook -- Sets the Progress Hook (V6)
  490.  
  491.    SYNOPSIS
  492.   MPProgressHook(Hook)
  493.                  A0
  494.  
  495.   void MPProgressHook(struct Hook*);
  496.  
  497.    FUNCTION
  498.   Sets the Hook to call for progress messages.
  499.  
  500.    INPUTS
  501.   Hook - Hook to call
  502.  
  503.    RESULT
  504.   None.
  505.  
  506.    EXAMPLE
  507.  
  508.    NOTES
  509.   Called with...
  510.  object = MPIP_MAX, (ULONG)message = max-progress
  511.  object = MPIP_MAX, (ULONG)message = curr-progress
  512.  object = MPIP_CURR,(UBYTE *)message = Progress-Message
  513.  
  514.    BUGS
  515.  
  516.    SEE ALSO
  517.  
  518. MPImage.library/MPRGBToGrey                        MPImage.library/MPRGBToGrey
  519.  
  520.    NAME   
  521.   MPRGBToGrey -- Convert RGB image to GreyScale (V7)
  522.  
  523.    SYNOPSIS
  524.   MPRGBToGrey(MPp,Linear);
  525.               A0  D0
  526.  
  527.   void MPRGBToGrey
  528.              (struct MPProcess *,BOOL);
  529.  
  530.    FUNCTION
  531.   Convert RGB image to GreyScale.
  532.  
  533.    INPUTS
  534.   MPp      - Contains the Red,Green and Blue chunky pixels
  535.              and the Width and Height
  536.   Linear   - If True then map linear,
  537.              otherwise give more weight to Green.
  538.  
  539.    RESULT
  540.   The data pointed to by MPp->Red is updated to the GreyScale pixels.
  541.  
  542.    EXAMPLE
  543.  
  544.    NOTES
  545.  
  546.    BUGS
  547.   Not tested.
  548.  
  549.    SEE ALSO
  550.  
  551. MPImage.library/MPRGBToPal                          MPImage.library/MPRGBToPal
  552.  
  553.    NAME   
  554.   MPRGBToPal -- Convert RGB image to a palette (V7)
  555.  
  556.    SYNOPSIS
  557.   MPRGBToPal( MPp,maxcol,pal,bit12 )
  558.               A0  D0     A1  D1
  559.  
  560.   void MPRGBToPal
  561.                 ( struct MPProcess *,ULONG,UBYTE *,BOOL);
  562.  
  563.    FUNCTION
  564.   Convert RGB to a palette.
  565.  
  566.    INPUTS
  567.   MPp      - Contains the Red,Green and Blue chunky pixels
  568.              and the Width and Height
  569.   maxcol   - The number of colours in the palette.
  570.   pal      - The palette. This is a 768 byte array.
  571.              pal[0] to pal[maxcol] hold the Red palette
  572.              pal[256] to pal[256+maxcol] hold the Green palette
  573.              pal[512] to pal[512+maxcol] hold the Blue palette
  574.   bit12    - If set then only the top 4 bits of the palette
  575.              are used and the mapping is far quicker.
  576.  
  577.    RESULT
  578.   The data pointed to by MPp->Red is updated to the palette mapped image.
  579.  
  580.    EXAMPLE
  581.  
  582.    NOTES
  583.   If there is insufficient memory then bit12 is treated as false.
  584.  
  585.    BUGS
  586.   Not tested.
  587.  
  588.    SEE ALSO
  589.   MPGreyToPal().
  590.  
  591. MPImage.library/MPScaleGrey                        MPImage.library/MPScaleGrey
  592.  
  593.    NAME   
  594.   MPScaleGrey -- Scales a GreyScale image (V7)
  595.  
  596.    SYNOPSIS
  597.   MPScaleGrey( Old,New,OWidth,OHeight,NWidth,NHeight,Temp)
  598.                A0  A1  D0     D1      D2     D3      A2
  599.  
  600.   void MPScaleGrey
  601.            ( UBYTE *,UBYTE *,UWORD,UWORD,UWORD,UWORD,UBYTE *);
  602.  
  603.    FUNCTION
  604.   Scales an RGB image.
  605.  
  606.    INPUTS
  607.   Old      - Contains existing chunky pixels.
  608.   New      - Buffer for the new chunky pixels.
  609.   OWidth   - Current Width.
  610.   OHeight  - Current Height.
  611.   NWidth   - New Width.
  612.   NHeight  - New Height.
  613.   Temp     - Temporary buffer sized for the new image.
  614.  
  615.    RESULT
  616.   The data pointed to by New is updated to the scaled image.
  617.  
  618.    EXAMPLE
  619.  
  620.    NOTES
  621.  
  622.    BUGS
  623.   Not tested.
  624.  
  625.    SEE ALSO
  626.   MPScaleRGB().
  627.  
  628. MPImage.library/MPScaleRGB                          MPImage.library/MPScaleRGB
  629.  
  630.    NAME   
  631.   MPScaleRGB -- Scales an RGB image (V7)
  632.  
  633.    SYNOPSIS
  634.   MPScaleRGB( Old,New,Temp)
  635.               A0  A1  A2
  636.  
  637.   void MPScaleRGB
  638.            ( struct MPProcess *,struct MPProcess *,struct MPProcess *);
  639.  
  640.    FUNCTION
  641.   Scales an RGB image.
  642.  
  643.    INPUTS
  644.   Old      - Contains the Red,Green and Blue chunky pixels
  645.              and the Width and Height of the current image.
  646.   New      - Contains the Red,Green and Blue chunky pixels
  647.              and the Width and Height for the new image.
  648.   Temp     - Contains 3 temporary buffers sized for the new image.
  649.  
  650.    RESULT
  651.   The data pointed to by New->Red/Green/Blue is updated to 
  652.   the scaled image.
  653.  
  654.    EXAMPLE
  655.  
  656.    NOTES
  657.  
  658.    BUGS
  659.   Not tested.
  660.  
  661.    SEE ALSO
  662.   MPScaleGrey().
  663.  
  664. MPImage.library/RescaleMPImage                  MPImage.library/RescaleMPImage
  665.  
  666.    NAME   
  667.   RescaleMPImage -- Scales an image created by LoadMPImage() (V3)
  668.  
  669.    SYNOPSIS
  670.   error = RescaleMPImage(MPi, x, y)
  671.   D0                     A0   D0 D1
  672.  
  673.   BOOL RescaleMPImage(struct MPImage *, UWORD, UWORD);
  674.  
  675.    FUNCTION
  676.   Scales an Image loaded by LoadMPImage() to new width and height.
  677.  
  678.    INPUTS
  679.   MPi - Image loaded by LoadMPImage
  680.   x   - New width of image
  681.   y   - New height of image
  682.  
  683.    RESULT
  684.   error - 1 for success, 0 for failure.
  685.           Use MPImageErrorMessage() to get error.
  686.  
  687.    EXAMPLE
  688.  
  689.    NOTES
  690.   Rescaling of bitmaps is done using BitMapScale().
  691.   Other rescaling is done using custom code with smoothing.
  692.  
  693.   If this function fails then the MPImage is no longer usable and
  694.   FreeMPImage() should be called to free it.
  695.  
  696.   Version 4.3 is faster for RGB.
  697.  
  698.    BUGS
  699.   Bitmaps may not scale smoothly.
  700.   The rescaling of EGS images is not efficent.
  701.  
  702.    SEE ALSO
  703.   LoadMPImage(),MPImageErrorMessage(),FreeMPImage(),
  704.   graphics.library/BitMapScale().
  705.  
  706. MPImage.library/SaveMPImageA                      MPImage.library/SaveMPImageA
  707.  
  708.    NAME   
  709.   SaveMPImageA -- Save an image in various formats. (V3)
  710.   SaveMPIMage -- Varargs version of SaveMPImageA (V3)
  711.  
  712.    SYNOPSIS
  713.   succ = SaveMPImageA( file,red,green,blue,width,height,taglist)
  714.   D0                   A0   A1  A2    A3   D0    D1     A5
  715.  
  716.   BOOL SaveMPImageA( UBYTE *,UBYTE *,UBYTE *,UBYTE *,
  717.                                    UWORD,UWORD,struct TagItem *);
  718.  
  719.   succ = SaveMPImage( file,red,green,blue,width,height,Tag1, ...)
  720.  
  721.   BOOL SaveMPImage( UBYTE *,UBYTE *,UBYTE *,UBYTE *,
  722.                                    UWORD,UWORD,ULONG,...);
  723.  
  724.    FUNCTION
  725.   Saves/displays an image held in chunky buffers.
  726.  
  727.    INPUTS
  728.   file    - filename to save file as. If NULL or "" then image is
  729.             displayed on a custom screen, or returned in BitMap (V7.0)
  730.   red     - red chunky input.
  731.   green   - green chunky input.
  732.   blue    - blue chunky input.
  733.   width   - width of chunky buffers
  734.   height  - height of chunky buffers.
  735.   taglist - pointer to TagItem array.
  736.  
  737.   Tags are:
  738.  
  739.   MPIS_MODE   - Data is ULONG CAMG of output IFF file/screen EHB and HAM
  740.                 will be added if required. If not supplied then
  741.                 MPIS_MODENAME will be used. If that is not supplied then
  742.                 a CAMG mode will be generated.
  743.   MPIS_MODENAME - Data is char * mode name of CAMG of output. Invalid
  744.                   names are ignored.
  745.   MPIS_FORMAT - Data is char * specifying output format.
  746.                 Default is MPI_BW16. Values are:
  747.                 MPI_BW16   - "BW16"   - 16 colour ILBM grey scale.
  748.                 MPI_BW256  - "BW256"  - 256 colour ILBM grey scale.
  749.                 MPI_HAM6   - "HAM6"   - HAM6 with fixed (internal) palette.
  750.                 MPI_HAM6P  - "HAM6P"  - HAM6 with generated or supplied
  751.                                         palette - see MPIS_PALETTE.
  752.                 MPI_HAM8   - "HAM8"   - HAM8 with fixed (internal) palette.
  753.                 MPI_HAM8P  - "HAM8P"  - HAM8 with generated or supplied
  754.                                         palette - see MPIS_PALETTE.
  755.                 MPI_ILBM24 - "ILBM24" - 24 bit ILBM.
  756.                 MPI_PPM    - "PPM"    - P6 (or P5 if red,green and blue are
  757.                                         the same).
  758.                 MPI_COLOUR - "COLOUR" - ILBM with generated or supplied
  759.                                         palette - see MPIS_PALETTE.
  760.                 MPI_EHB    - "EHB"    - EHB with generated or supplied
  761.                                         palette - see MPIS_PALETTE.
  762.                 MPI_JPEG   - "JPEG"   - JPEG see NOTES.
  763.                 MPI_PNM    - "PNG"    - PNG see NOTES.
  764.                 MPI_DCTV3  - "DCTV3"  - DCTV 3 bit plane format
  765.                 MPI_DCTV4  - "DCTV4"  - DCTV 4 bit plane format
  766.   MPIS_PALETTE - Data is char * name of ILBM to load palette from.
  767.   MPIS_COLOURS - Data is ULONG number of colours for MPI_COLOUR.
  768.                  Default is is number of colours in MPIS_PALETTE if
  769.                  supplied, otherwise 16. If greater than that from
  770.                  MPIS_PALETTE then ignored.
  771.   MPIS_12BIT   - Data is BOOL. If TRUE then use faster 12bit colour palette
  772.                  generating algorithm for MPI_COLOUR and MPI_EHB. Default
  773.                  is FALSE to use 18bit algorithm.
  774.   MPIS_LINEAR  - Data is BOOL. If TRUE then for BW16/BW256 use linear
  775.                  (not colour based) mapping. (V5.0)
  776.   MPIS_GREYMAP - Data is UBYTE *. For BW16/BW256 palette map. Must point
  777.                  to at least 16 of value 0 to 15 for BW16, 256 bytes of
  778.                  0 to 255 for BW255. (V5.0)
  779.                  Format is e.g. 0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1
  780.                    Colour 0 will be black
  781.                    Colour 1 will be white
  782.                    etc.
  783.                  This is the opposite to which you may expect!
  784.   MPIS_OLDPALETTE - Palette to use (for HAMxP/COLOUR/EHB) (V7.0)
  785.                     Data is UBYTE *, red in [0] to [255],
  786.                                      green in [256] to [511]
  787.                                      blue in [512] to [767]
  788.   MPIS_NEWPALETTE - Palette used (for HAMx/COLOUR/EHB) (V7.0)
  789.                     Data is UBYTE * (see MPIS_OLDPALETTE).
  790.   MPIS_BITMAP  - BitMap to update (for BWxx/HAMxx/COLOUR/EHB/DCTVx) (V7.0)
  791.                  Data is struct BitMap *
  792.                  Image is not displayed/saved
  793.  
  794.    RESULT
  795.   error - 1 for success, 0 for failure.
  796.           Use MPImageErrorMessage() to get error.
  797.  
  798.    EXAMPLE
  799.  
  800.    NOTES
  801.   If MPIS_FORMAT is BW16 or BW256 and red,green and blue are the same then
  802.   a more efficent algorithm is used.
  803.  
  804.   When displaying on screen click in the top left and press a key to exit.
  805.  
  806.   If file format is JPEG and env/mpimage/cjpeg is set (e.g. cjpeg "%s" "%s")
  807.   then cjpeg is used.
  808.  
  809.   If file format is PNG and env/mpimage/pnmtopng is set
  810.   (e.g. 'pnmtopng "%s" >"%s"') then pnmtopng is used.
  811.  
  812.    BUGS
  813.   Does not work for images > 1024 wide (except PPM/JPEG/PNG).
  814.   The palette file requires a body which is loaded and then discarded.
  815.  
  816.   Waits 20 seconds for cjpeg/pnmtopng to start then aborts. This check is
  817.   not fool proof and the PIPE:xxx can be left hanging.
  818.  
  819.   Prior to version 4.3 fails to determine a screen mode correctly.
  820.  
  821.   V7.0 did not handle MPIS_BITMAP correctly.
  822.  
  823.    SEE ALSO
  824.   MPImageErrorMessage().
  825.  
  826. MPImage.library/SetMPImageScreen              MPImage.library/SetMPImageScreen
  827.  
  828.    NAME   
  829.   SetMPImageScreen -- Sets the Screen name for progress requesters (V3)
  830.  
  831.    SYNOPSIS
  832.   SetMPImageScreen(ScreenName,Flags)
  833.                    A0         D0
  834.  
  835.   void SetMPImageScreen(char *, ULONG);
  836.  
  837.    FUNCTION
  838.   Sets the Screen Name for progress requesters for this opener.
  839.  
  840.    INPUTS
  841.   ScreenName - Name of Public Screen, NULL for default
  842.   Flags      - 0 - Do not show progress requesters (default)
  843.              - MPIF_PROGRESS - Do show progress requesters
  844.                                (except for non remapped bitmaps).
  845.  
  846.    RESULT
  847.   None.
  848.  
  849.    EXAMPLE
  850.  
  851.    NOTES
  852.   ScreenName must remain valid while MPImage.library is open.
  853.  
  854.    BUGS
  855.  
  856.    SEE ALSO
  857.  
  858.